<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li :class="{ completed:item.isDone}" v-for="item in list" :key="item.id">
      <div class="view">
        <input v-model="item.isDone" class="toggle" type="checkbox" />
        <label>{{ item.name }}</label>
        <button @click="delBtn(item.id)" class="destroy"></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: ["list"],
  methods: {
    delBtn(id) {
        this.$emit('dalTack',id)
    },
  },
};
</script>